HTMLify
index.html
Views: 350 | Author: cody
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>Intro Text Animation</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" type="text/css" media="screen" href="style.css" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script> </head> <body> <section class="splash"> <h1>The world is <span>complicated</span>.</h1> <div class="splash__bg"> <span class="js-circle"></span> <span class="js-circle"></span> <span class="js-circle"></span> <span class="js-circle"></span> <span class="js-circle"></span> <span class="js-circle"></span> <span class="js-circle"></span> <span class="js-circle"></span> </div> </section> <script> const circleEls = document.querySelectorAll(".js-circle"); const circleTl = gsap.timeline({ repeat: -1, yoyo: true }); let circleSize = 1; circleEls.forEach((circle) => { gsap.set(circle, { scale: circleSize }); circleSize += 0.5; }); circleTl.from(circleEls, { scale: 1, stagger: 0.175, duration: 0.6, ease: Power3.inOut, }); </script> </body> </html> |